// https://iai.sh.cn/problem/737
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll mod = 1e9 + 7;
vector<ll> e[200005];
ll dp[200005][2];
// dp[u][0]: 不含有以u节点作为根的连通子图个数
// dp[u][1]: 含有以u节点作为根的连通子图个数

void dfs(ll u) {
  dp[u][1] = 1;
  for (int i = 0; i < e[u].size(); i++) {
    ll son = e[u][i];
    dfs(son);

    (dp[u][0] += dp[son][1] + dp[son][0]) %= mod;
    (dp[u][1] *= (dp[son][1] + 1)) %= mod;
  }
}

int main() {
  ll n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    ll x;
    cin >> x;
    e[x].push_back(i);
  }
  dfs(1);
  cout << (dp[1][0] + dp[1][1]) % mod << endl;
  return 0;
}